package o;

import android.content.Context;
import android.text.TextUtils;
import com.huawei.hms.framework.network.grs.GrsApi;
import com.huawei.hms.framework.network.grs.GrsBaseInfo;
import com.huawei.hms.framework.network.grs.IQueryUrlsCallBack;
import java.util.Map;

public class duz {
    private Context ˋ;
    private String ˏ;
    private String ॱ;

    public duz(Context context, String str) {
        this.ˋ = context;
        this.ॱ = str;
    }

    private void ˏ() {
        GrsBaseInfo grsBaseInfo = new GrsBaseInfo();
        grsBaseInfo.setAppName(this.ॱ);
        grsBaseInfo.setSerCountry(this.ˏ);
        grsBaseInfo.setCountrySource(this.ˏ);
        GrsApi.grsSdkInit(this.ˋ, grsBaseInfo);
    }

    public void ˊ(IQueryUrlsCallBack iQueryUrlsCallBack, String str) {
        Object ॱ = eqp.ॱ();
        if (TextUtils.isEmpty(ॱ)) {
            this.ˏ = eqp.ͺ();
        } else {
            this.ˏ = ॱ;
        }
        if (TextUtils.isEmpty(this.ˏ)) {
            iQueryUrlsCallBack.onCallBackFail(705);
            Logger.e("GrsConfigObtainer", "GrsProcesser Start Failed,homeCountry[" + this.ˏ + "] is isEmpty");
            return;
        }
        ˏ();
        GrsApi.ayncGetGrsUrls(str, iQueryUrlsCallBack);
    }

    public Map<String, String> ˎ(String str) {
        this.ˏ = eqp.ॱ();
        if (TextUtils.isEmpty(this.ˏ)) {
            this.ˏ = eqp.ͺ();
        }
        if (TextUtils.isEmpty(this.ˏ)) {
            Logger.e("GrsConfigObtainer", "getGrsUrls Failed,homeCountry[" + this.ˏ + "] is isEmpty");
            return null;
        }
        ˏ();
        return GrsApi.synGetGrsUrls(str);
    }

    protected boolean ॱ() {
        String ॱ = eqp.ॱ();
        if (TextUtils.isEmpty(ॱ)) {
            ॱ = eqp.ͺ();
        }
        boolean z = (TextUtils.isEmpty(this.ˏ) || this.ˏ.equalsIgnoreCase(ॱ)) ? false : true;
        Logger.ˏ("GrsConfigObtainer", "homeCountryChange=" + z);
        return z;
    }
}
